// Created by Windward Studios - no copyright is claimed. This code can be used in
// any manner by anyone for any reason. There is no copyright of any kind on it. You may
// use it in commercial products. You may change it without sharing those changes.
// We ask that you keep the "created by Windward Studios" in a comment at the top.

using System;
using System.Globalization;

namespace Kailua.net.windward.utils.datetime
{
	/// <summary>
	/// The missing propert from the culture DateTime information.
	/// </summary>
	public class DateTimeUtils
	{
		/// <summary>
		/// Returns true if the passed in day is a weekend for the culture. At present this is Fri/Sat for Hebrew
		/// and Arabic and Sat/Sun for all else
		/// </summary>
		/// <param name="culture">The culture of the user.</param>
		/// <param name="dow">The day to check.</param>
		/// <returns>True if it's a weekend.</returns>
		public static bool IsWeekend(CultureInfo culture, DayOfWeek dow)
		{
			if (culture.IetfLanguageTag.StartsWith("ar") || culture.IetfLanguageTag.StartsWith("he"))
				return (dow == DayOfWeek.Friday) || (dow == DayOfWeek.Saturday);
			return (dow == DayOfWeek.Saturday) || (dow == DayOfWeek.Sunday);
		}
	}
}